package puzzle.projecteuler.p200;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;

public class Problem107C {

	/**
	 * min spanning-tree
	 * 
	 * @param args
	 */
	public static void main(String[] args) throws IOException {

		readData();
	}

	public static Integer[][] readData() throws IOException {

		URL url = Problem107C.class.getResource("Problem107.txt");
		File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));

		Integer[][] datas = new Integer[40][];
		BufferedReader br = new BufferedReader(new FileReader(file));
		String line = null;
		int r = 0;
		while ((line = br.readLine()) != null) {
			String[] tmp = line.split(",");
			datas[r] = new Integer[40];
			for (int c = 0; c < datas[r].length; c ++) {
				if ("-".equalsIgnoreCase(tmp[c])) {
					datas[r][c] = null;
				} else {
					datas[r][c] = Integer.valueOf(tmp[c]);
				}
			}
			r ++;
		}
		br.close();
		return datas;
	}

}
